<?=modules::run("website/big_images/installations");?>


  <div id="content-wrap">
  <div class="inner">
    <div class="left">

        <?//=modules::run("subnavigation/submenu/search", $results);?>  

        <? 
        if (!empty($results)){ 
        
            if ($filter == FALSE){
        ?>                                                     
                     
                <div class="summarycontainer">
                    <p><strong>Filter Results:</strong><br/>

                <?
                    foreach($results as $result)
                    {
                ?>
                  <a href="<?=site_url('search/results/'.$result['id'])?>"><?=$result['label']?> (<?=count($result['items'])?>)</a><br/>
                <?
                    }
                ?>

                    </p>
                </div>

        <?  
            } else { 
        ?>

               <div class="summarycontainer">
                    <p><strong>Results narrowed by:</strong><br/>
                    <?=$filter?> (<?=count($results[0]['items'])?>)
                    </p>
                    <a href="<?=site_url('search/results')?>" class="more">show all results</a>
                </div>
             
        <?
            }
        }
        ?>

    </div>
    
    <div class="right">

        <?
        $breadcrumbs[] = array('display' => 'search', 'controller' => 'search', 'title' => 'Search'); 
        $breadcrumbs[] = array('display' => 'search results'); 
        print modules::run("subnavigation/breadcrumb/view", $breadcrumbs);
        ?> 

     <h1>Search</h1>                      
                       
     <form action="<?=site_url('search/results')?>" method="post">

        <input type="hidden" name="set_search_fields" value="true"/>
                  
         <p class="sansserif">
            <strong>Search within:</strong><br />
            <label><input name="products" type="checkbox" value="products" <? if(in_array('products', $search_areas)){?>checked=true"<?}?> /> Products</label><br />
            <label><input name="product_categories" type="checkbox" value="product_categories" <? if(in_array('product_categories', $search_areas)){?>checked=true"<?}?> /> Product categories</label><br />
            <label><input name="news" type="checkbox" value="news"  <? if(in_array('news', $search_areas)){?>checked=true"<?}?> /> News</label><br />
            <label><input name="publicity" type="checkbox" value="publicity" <? if(in_array('publicity', $search_areas)){?>checked=true"<?}?> /> Publicity</label><br />
            <label><input name="portfolio" type="checkbox" value="portfolio" <? if(in_array('portfolio', $search_areas)){?>checked=true"<?}?> /> Portfolio</label><br />
            <label><input name="glossary" type="checkbox" value="glossary" <? if(in_array('glossary', $search_areas)){?>checked=true"<?}?> /> Glossary</label><br/>
            <label><input name="articles" type="checkbox" value="articles" <? if(in_array('articles', $search_areas)){?>checked=true"<?}?> /> Articles</label><br/>
            <label><input name="exhibitions" type="checkbox" value="exhibitions" <? if(in_array('exhibitions', $search_areas)){?>checked=true"<?}?> /> Exhibitions</label>
         </p>


         <div id="mainsearch">

            <table border="0" cellspacing="0" cellpadding="0" width="100%">
            <tbody>
                <tr>
                    <td><input name="search" type="text" class="inputbox" onfocus="clearMe(this)" value="<?=$search_string?>" style="width:300px;"/></td>
                    <td><input class="submitbox" name="search_submit" value="SUBMIT" onmouseover="this.src='<?=base_url()?>assets/website/images/buttons<?=INSTANCE_FILE_SUFFIX ?>/findbutton_f2.gif'" onmouseout="this.src='<?=base_url()?>assets/website/images/buttons<?=INSTANCE_FILE_SUFFIX ?>/findbutton.gif'" alt="Find" src="<?=base_url()?>assets/website/images/buttons<?=INSTANCE_FILE_SUFFIX ?>/findbutton.gif" type="image" /></td>
                </tr>
            </tbody>
            </table>

        </div>

     </form>


<? if (empty($search_areas)) { ?>
    <p class="sansserif">Please specify the areas you want to search in</p>
<? } else if (empty($results)) { ?>
    <p class="sansserif">Your search for '<?=$search_string?>' found no results</p>
<? } ?>


<?
foreach ($results as $result) {
?>

    <div class="headercontain">
        <p>Results for '<?=$search_string?>' within <?=$result['label']?>: </p>
    </div>

<?
    if ($result['id'] == 'products') { 

        $list["items"] = $result['items'];
        $list["controller"] = "products/view/";
		$list['img_folder'] = base_url().UPLOADS_FOLDER.PRODUCT_IMG_FOLDER;
        $list["search_string"] = $search_string;
        $this->load->view('website/lists/search_items', $list);
    
                                                             
    } else if ($result['id'] == 'product_categories') { 

        $list["items"] = $result['items'];
        $list["controller"] = "products/categories/";    
		$list['img_folder'] = base_url().UPLOADS_FOLDER.PRODUCT_IMG_FOLDER;                                     
        $list["search_string"] = $search_string;
        $this->load->view('website/lists/search_items', $list);
                                                             
    } else if ($result['id'] == 'portfolio') { 

        $list["items"] = $result['items'];
        $list["controller"] = "portfolio/view/";
		$list['img_folder'] = base_url().UPLOADS_FOLDER.PORTFOLIO_IMG_FOLDER;		
        $list["search_string"] = $search_string;
        $this->load->view('website/lists/search_items', $list);

    } else if ($result['id'] == 'glossary') { 

        $list["items"] = $result['items'];
        $list["controller"] = "glossary/view/"; 
		$list['img_folder'] = base_url().UPLOADS_FOLDER.GLOSSARY_IMG_FOLDER;		
        $list["search_string"] = $search_string;
        $this->load->view('website/lists/search_items', $list);

    } else if ($result['id'] == 'news') {              

        $list["items"] = $result['items'];
        $list["controller"] = "news/view/";     
		$list['img_folder'] = base_url().UPLOADS_FOLDER.NEWS_IMG_FOLDER;
        $list["search_string"] = $search_string;
        $this->load->view('website/lists/search_items', $list);

    } else if ($result['id'] == 'publicity') {              

        $list["items"] = $result['items'];
        $list["controller"] = "publicity/view/";
		$list['img_folder'] = base_url().UPLOADS_FOLDER.PUBLICITY_IMG_FOLDER;
        $list["search_string"] = $search_string;
        $this->load->view('website/lists/search_items', $list);

    } else if ($result['id'] == 'articles') {              

        $list["items"] = $result['items'];
        $list["controller"] = "articles/view/"; 
		$list['img_folder'] = base_url().UPLOADS_FOLDER.ARTICLES_IMG_FOLDER;		
        $list["search_string"] = $search_string;
        $this->load->view('website/lists/search_items', $list);

    } else if ($result['id'] == 'exhibitions') {              

        $list["items"] = $result['items'];
        $list["controller"] = "exhibitions/view/";   
		$list['img_folder'] = base_url().UPLOADS_FOLDER.EXHIBITIONS_IMG_FOLDER;		
        $list["search_string"] = $search_string;
        $this->load->view('website/lists/search_items', $list);

    }
}
?>




<div class="widget">    
    <!-- AddThis Button BEGIN -->
    <a href="http://www.addthis.com/bookmark.php?v=250" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"><img src="http://s7.addthis.com/static/btn/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a>
    <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js?pub=xa-4a360d252cc10889"></script>
    <script type="text/javascript">
        var addthis_exclude = 'email, print';
    </script>
<!-- AddThis Button END -->
</div>

        
    </div>
  </div>
  </div>
